Reference:

Dey, A. K., Gel, Y. R., & Poor, H. V. (2019). What network motifs tell us about resilience and reliability of complex networks. Proceedings of the National Academy of Sciences of the United States of America, 116(39), 19368–19373. https://doi.org/10.1073/pnas.1819529116

The function simulate the idea of finding four-node motifs in the article above. As defined in the article, there will be 6 possible 4-node motifs in an undirected, unweighted graph (Dey et al., 2019).

Random Attack

Betweeness-based Attack

Degree-based Attack

Product of betweeness and degree attack

Visualization